[IA64] create free_irq()
authorAlex Williamson <alex.williamson@hp.com>
Mon, 11 Jun 2007 19:59:48 +0000 (13:59 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Mon, 11 Jun 2007 19:59:48 +0000 (13:59 -0600)
This isn't well tested, since it's not likely to get called, but
it is required to build.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
xen/arch/ia64/xen/irq.c

index 079f445defda8113b58e40ace3bc989282466951..02cb7e9c7673dd96e171df8aa2b11468411d80f1 100644 (file)
@@ -281,6 +281,30 @@ int setup_irq(unsigned int irq, struct irqaction * new)
        return res;
 }
 
+void free_irq(unsigned int irq)
+{
+       unsigned int vec;
+       unsigned long flags;
+       irq_desc_t *desc;
+
+       /* Get vector for IRQ.  */
+       if (acpi_gsi_to_irq(irq, &vec) < 0)
+               return;
+
+       desc = irq_descp(vec);
+
+       spin_lock_irqsave(&desc->lock, flags);
+       clear_bit(vec, ia64_xen_vector);
+       desc->action = NULL;
+       desc->depth = 1;
+       desc->status |= IRQ_DISABLED;
+       desc->handler->shutdown(vec);
+       spin_unlock_irqrestore(&desc->lock, flags);
+
+       while (desc->status & IRQ_INPROGRESS)
+               cpu_relax();
+}
+
 /*
  * HANDLING OF GUEST-BOUND PHYSICAL IRQS
  */